package ar.fiuba.tp7552.buildadmin.webactions.planes;

import ar.fiuba.tp7552.buildadmin.dao.LiquidacionPlanDao;
import ar.fiuba.tp7552.buildadmin.model.planes.LiquidacionPlan;
import ar.fiuba.tp7552.buildadmin.webactions.BaseAction;

import com.opensymphony.xwork2.Preparable;

public class LiquidacionPlanAction extends BaseAction implements Preparable {

	private LiquidacionPlanDao liquidacionPlanDao;

	private LiquidacionPlan liquidacion;
	// ~~ Constructor ====================================================
	public LiquidacionPlanAction(LiquidacionPlanDao liquidacionPlanDao) {
		super();
		this.liquidacionPlanDao = liquidacionPlanDao;
	}

	// ~~ Actions ========================================================

	@Override
	public void prepare() throws Exception {
		if (liquidacion != null && liquidacion.getId() != null) {
			liquidacion = liquidacionPlanDao.get(liquidacion.getId());
		}
	}
	
	public String load() {
		return BaseAction.SUCCESS;
	}
	
	// ~~ getters y setters ========================================================
	public LiquidacionPlan getLiquidacion() {
		return liquidacion;
	}

	public void setLiquidacion(LiquidacionPlan liquidacion) {
		this.liquidacion = liquidacion;
	}
}
